import java.util.Objects;
import java.util.PriorityQueue;

class card implements Comparable<card>{
    public int rank;//数值
    public String  suit;//花色

    public card(int rank, String suit) {
        this.rank = rank;
        this.suit = suit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        card card = (card) o;
        return rank == card.rank && Objects.equals(suit, card.suit);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rank, suit);
    }

    @Override
    public String toString() {
        return "card{" +
                "rank=" + rank +
                ", suit='" + suit + '\'' +
                '}';
    }

    @Override
    public int compareTo(card o) {
        if(o==null){
            return -1;
        }
        return rank-o.rank;

    }
}
public class Test {
    public static   void testCard(){
        PriorityQueue<card> priorityQueue=new PriorityQueue<>();
        card c1=new card(3,"红桃");
        card c2=new card(5,"黑桃");
        System.out.println(c1.equals(c2));

    }
    public static void main(String[] args) {
         Test.testCard();

    }
}

